package com.iflytek.day10;

/**
 * 1.私有化全部的成员变量
 * 3.空参构造
 * 5.带全部参数的构造
 * 5.针对于每一个私有化的成员变量都要提供其对应的get和set方法
 * 5.如果当前事物还有其他行为，那么也要写出来，比如学生的吃饭，睡觉等行为
 */
public class _08_User {

  private String username;// 用户名
  private String password;// 密码
  private String email;// 邮箱
  private char gender;// 性别
  private int age;// 年龄

  // 空参构造方法
  public _08_User() {
  }

  // 带全部参数的构造
  public _08_User(String username, String password, String email, char gender, int age) {
    this.username = username;
    this.password = password;
    this.email = email;
    this.gender = gender;
    this.age = age;
  }

  // get和set

  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }

  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }

  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public char getGender() {
    return gender;
  }

  public void setGender(char gender) {
    this.gender = gender;
  }

  public int getAge() {
    return age;
  }

  public void setAge(int age) {
    this.age = age;
  }

  public void eat() {
    System.out.println(username + "在吃饭");
  }
}